package p.ithorns.example;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * ExampleApp
 *
 * @author Ht.L
 * @date 2024-03-08 14:31
 * @since 1.0.0
 */
@EnableScheduling
@EnableFeignClients
@SpringBootApplication
public class ConsumerApp implements CommandLineRunner {

    @Autowired
    ApplicationContext ctx;

    public static void main(String[] args) {
        SpringApplication.run(ConsumerApp.class, args);
    }

    @Autowired
    private HelloApi helloApi;

    @Override
    public void run(String... args) throws Exception {
        // 这里调用的是 HelloFeignClient
        String res = helloApi.param("Bigo");
        System.out.println(res);
    }

}